#!/usr/bin/env python
# -*- coding: utf-8 -*-
#coding=utf8

# 本文件由自动工具 proto.py 自动生成，请勿修改
# filename msg21000_csbuf.py
# package ptl

from ptl.base_csbuf import *


# message Req21001
class Req21001:
	def __init__(self):
		self.protoid = 21001
		pass

	def Marshal(writer):
		pass

	def Unmarshal( reader):
		pass
# message Resp21001
class Resp21001:
	def __init__(self):
		self.protoid = 21001
		self.infos = []

	def Marshal(writer):
		countinfos = len(self.infos)
		writer.setArray(countinfos, 1)
		for i in range(countinfos):
			writer.setMessage(0)
			self.infos[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		for i in range(reader.getArray(1)):
			msg = MoreHeroPub() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.infos.append(msg)
# message Req21003
class Req21003:
	def __init__(self):
		self.protoid = 21003
		self.heroId = 0
		self.levelId = 0
		self.hero_id = 0

	def Marshal(writer):
		writer.setUint32(self.heroId, 1)
		writer.setUint32(self.levelId, 2)
		writer.setUint32(self.hero_id, 3)

	def Unmarshal( reader):
		self.heroId = reader.getUint32(1)
		self.levelId = reader.getUint32(2)
		self.hero_id = reader.getUint32(3)
# message Resp21003
class Resp21003:
	def __init__(self):
		self.protoid = 21003
		self.status = 0
		self.hero_id = 0
		self.levelId = 0
		self.npcInfo = []
		self.heroInfo = MoreHeroInfo()

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		writer.setUint32(self.hero_id, 2)
		writer.setUint32(self.levelId, 3)
		countnpcInfo = len(self.npcInfo)
		writer.setArray(countnpcInfo, 4)
		for i in range(countnpcInfo):
			writer.setMessage(0)
			self.npcInfo[i].Marshal(writer)
			writer.endSetMessage()
		writer.setMessage(5)
		self.heroInfo.Marshal(writer)
		writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		self.hero_id = reader.getUint32(2)
		self.levelId = reader.getUint32(3)
		for i in range(reader.getArray(4)):
			msg = MoreNpcInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.npcInfo.append(msg)
		reader.getMessage(5)
		self.heroInfo.Unmarshal(reader)
		reader.endGetMessage()
# message Req21005
class Req21005:
	def __init__(self):
		self.protoid = 21005
		self.status = 0
		self.levelId = 0
		self.hero_id = 0
		self.heroInfo = MoreHeroInfo()
		self.npcInfo = []

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		writer.setUint32(self.levelId, 2)
		writer.setUint32(self.hero_id, 3)
		writer.setMessage(4)
		self.heroInfo.Marshal(writer)
		writer.endSetMessage()
		countnpcInfo = len(self.npcInfo)
		writer.setArray(countnpcInfo, 5)
		for i in range(countnpcInfo):
			writer.setMessage(0)
			self.npcInfo[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		self.levelId = reader.getUint32(2)
		self.hero_id = reader.getUint32(3)
		reader.getMessage(4)
		self.heroInfo.Unmarshal(reader)
		reader.endGetMessage()
		for i in range(reader.getArray(5)):
			msg = MoreNpcInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.npcInfo.append(msg)
# message Resp21005
class Resp21005:
	def __init__(self):
		self.protoid = 21005
		self.status = 0
		self.rewards = []

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		countrewards = len(self.rewards)
		writer.setArray(countrewards, 2)
		for i in range(countrewards):
			writer.setMessage(0)
			self.rewards[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		for i in range(reader.getArray(2)):
			msg = RewardInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.rewards.append(msg)
# message Req21006
class Req21006:
	def __init__(self):
		self.protoid = 21006
		self.hero_id = 0

	def Marshal(writer):
		writer.setUint32(self.hero_id, 1)

	def Unmarshal( reader):
		self.hero_id = reader.getUint32(1)
# message Resp21006
class Resp21006:
	def __init__(self):
		self.protoid = 21006
		self.status = 0
		self.results = []
		self.infos = MoreHeroPub()

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		countresults = len(self.results)
		writer.setArray(countresults, 2)
		for i in range(countresults):
			writer.setMessage(0)
			self.results[i].Marshal(writer)
			writer.endSetMessage()
		writer.setMessage(3)
		self.infos.Marshal(writer)
		writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		for i in range(reader.getArray(2)):
			msg = MoreHeroSweepResult() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.results.append(msg)
		reader.getMessage(3)
		self.infos.Unmarshal(reader)
		reader.endGetMessage()
# message Req21010
class Req21010:
	def __init__(self):
		self.protoid = 21010
		pass

	def Marshal(writer):
		pass

	def Unmarshal( reader):
		pass
# message Resp21010
class Resp21010:
	def __init__(self):
		self.protoid = 21010
		self.status = 0
		self.goods = []

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		countgoods = len(self.goods)
		writer.setArray(countgoods, 3)
		for i in range(countgoods):
			writer.setMessage(0)
			self.goods[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		for i in range(reader.getArray(3)):
			msg = MoreHeroGoods() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.goods.append(msg)
# message Req21011
class Req21011:
	def __init__(self):
		self.protoid = 21011
		self.goodsId = 0

	def Marshal(writer):
		writer.setUint32(self.goodsId, 1)

	def Unmarshal( reader):
		self.goodsId = reader.getUint32(1)
# message Resp21011
class Resp21011:
	def __init__(self):
		self.protoid = 21011
		self.status = 0

	def Marshal(writer):
		writer.setUint32(self.status, 1)

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
# message Req21012
class Req21012:
	def __init__(self):
		self.protoid = 21012
		pass

	def Marshal(writer):
		pass

	def Unmarshal( reader):
		pass
# message Resp21012
class Resp21012:
	def __init__(self):
		self.protoid = 21012
		self.status = 0
		self.goods = []

	def Marshal(writer):
		writer.setUint32(self.status, 1)
		countgoods = len(self.goods)
		writer.setArray(countgoods, 3)
		for i in range(countgoods):
			writer.setMessage(0)
			self.goods[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint32(1)
		for i in range(reader.getArray(3)):
			msg = MoreHeroGoods() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.goods.append(msg)
